package com.jrzh.db.migration.sys;

import com.jrzh.framework.migration.BaseMigration;
import com.jrzh.framework.migration.MigrationHelper;
/**
 * 新增短信消息表
 * @author XiaoBin
 *
 */
public class Migration_8 extends BaseMigration{
	
	private static final String TABLE_NAME_ONE = "sys_mobile_sms_send";
	private static final String TABLE_NAME_TWO = "sys_mobile_sms_sending";
	
	@Override
	public void down() {
		log.info("##########回滚Sys模块 Migration_8##########");
		MigrationHelper.dropTable(TABLE_NAME_ONE);
		MigrationHelper.dropTable(TABLE_NAME_TWO);
	}

	@Override
	public void up() {
		log.info("##########执行Sys模块 Migration_8##########Begin");
		table(TABLE_NAME_ONE, "短信存储表", true,
				pk(),
				jrVarchar("_mobile", "手机号", 25),
				jrVarchar("_body", "发送内容" , 600),
				jrTimestamp("_add_time", "添加时间")
		);
		table(TABLE_NAME_TWO, "短信发送表", true,
				pk(),
				jrTimestamp("_add_time", "添加时间"),
				jrVarchar("_mobile", "手机号", 25),
				jrVarchar("_body", "短信内容" , 600),
				jrVarchar("_is_sent", "是否已经发送 T：是  F：否", 10),
				jrBigint("_try_times", "尝试发送次数"),
				jrTimestamp("_sent_time", "发送的时间")
		);
		log.info("##########执行Sys模块 Migration_8##########End");
	}

}
